/**
  ******************************************************************************
  * File Name          : gpio.c
  * Description        : This file provides code for the configuration
  *                      of all used GPIO pins.
  ******************************************************************************
  * @attention
  *
  * <h2><center>&copy; Copyright (c) 2020 STMicroelectronics.
  * All rights reserved.</center></h2>
  *
  * This software component is licensed by ST under BSD 3-Clause license,
  * the "License"; You may not use this file except in compliance with the
  * License. You may obtain a copy of the License at:
  *                        opensource.org/licenses/BSD-3-Clause
  *
  ******************************************************************************
  */

/* Includes ------------------------------------------------------------------*/
#include "gpio.h"
/* USER CODE BEGIN 0 */

/* USER CODE END 0 */

/*----------------------------------------------------------------------------*/
/* Configure GPIO                                                             */
/*----------------------------------------------------------------------------*/
/* USER CODE BEGIN 1 */

/* USER CODE END 1 */

/** Configure pins as 
        * Analog 
        * Input 
        * Output
        * EVENT_OUT
        * EXTI
*/
void MX_GPIO_Init(void)
{

  GPIO_InitTypeDef GPIO_InitStruct = {0};

  /* GPIO Ports Clock Enable */
  __HAL_RCC_GPIOE_CLK_ENABLE();
  __HAL_RCC_GPIOF_CLK_ENABLE();
  __HAL_RCC_GPIOA_CLK_ENABLE();
  __HAL_RCC_GPIOC_CLK_ENABLE();
  __HAL_RCC_GPIOB_CLK_ENABLE();
  __HAL_RCC_GPIOG_CLK_ENABLE();
  __HAL_RCC_GPIOD_CLK_ENABLE();

  /*Configure GPIO pin Output Level */
  HAL_GPIO_WritePin(GPIOE, O_HuangKai_Pin|LED_Power_Pin|LED_Left_Pin|LED_Right_Pin 
                          |LED_Change_Pin|O_FuSheng_L_Pin|O_JiaJiang_Pin|O_JiaSheng_Pin 
                          |O_DingJiang_Pin|O_DingSheng_Pin|O_JiaTui_Pin|O_JiaJin_Pin 
                          |O_HuangSuo_Pin|O_Motor_Pin, GPIO_PIN_RESET);

  /*Configure GPIO pin Output Level */
  HAL_GPIO_WritePin(GPIOF, SC_Row1_Pin|SC_Row2_Pin|SC_Row3_Pin|SC_Row4_Pin 
                          |SC_Row5_Pin|SC_Row6_Pin|O_TuiDan_R_Pin|O_ZhuangDan_R_Pin 
                          |O_TuiDan_L_Pin|O_ZhuangDan_L_Pin|O_FuJiang_R_Pin, GPIO_PIN_RESET);

  /*Configure GPIO pin Output Level */
  HAL_GPIO_WritePin(GPIOA, O_LunSuo_R_Pin|O_LunShen_R_Pin|O_LunSuo_L_Pin, GPIO_PIN_RESET);

  /*Configure GPIO pin Output Level */
  HAL_GPIO_WritePin(GPIOC, O_LunShen_L_Pin|O_WeiJiang_R_Pin, GPIO_PIN_RESET);

  /*Configure GPIO pin Output Level */
  HAL_GPIO_WritePin(GPIOB, O_WeiSheng_R_Pin|O_WeiJiang_L_Pin|O_WeiSheng_L_Pin, GPIO_PIN_RESET);

  /*Configure GPIO pin Output Level */
  HAL_GPIO_WritePin(GPIOG, O_FuSheng_R_Pin|O_FuJiang_L_Pin, GPIO_PIN_RESET);

  /*Configure GPIO pins : PEPin PEPin PEPin PEPin 
                           PEPin PEPin PEPin PEPin 
                           PEPin PEPin PEPin PEPin 
                           PEPin PEPin */
  GPIO_InitStruct.Pin = O_HuangKai_Pin|LED_Power_Pin|LED_Left_Pin|LED_Right_Pin 
                          |LED_Change_Pin|O_FuSheng_L_Pin|O_JiaJiang_Pin|O_JiaSheng_Pin 
                          |O_DingJiang_Pin|O_DingSheng_Pin|O_JiaTui_Pin|O_JiaJin_Pin 
                          |O_HuangSuo_Pin|O_Motor_Pin;
  GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
  GPIO_InitStruct.Pull = GPIO_NOPULL;
  GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
  HAL_GPIO_Init(GPIOE, &GPIO_InitStruct);

  /*Configure GPIO pins : PFPin PFPin PFPin PFPin 
                           PFPin PFPin PFPin PFPin 
                           PFPin PFPin PFPin */
  GPIO_InitStruct.Pin = SC_Row1_Pin|SC_Row2_Pin|SC_Row3_Pin|SC_Row4_Pin 
                          |SC_Row5_Pin|SC_Row6_Pin|O_TuiDan_R_Pin|O_ZhuangDan_R_Pin 
                          |O_TuiDan_L_Pin|O_ZhuangDan_L_Pin|O_FuJiang_R_Pin;
  GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
  GPIO_InitStruct.Pull = GPIO_NOPULL;
  GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
  HAL_GPIO_Init(GPIOF, &GPIO_InitStruct);

  /*Configure GPIO pins : PFPin PFPin PFPin PFPin */
  GPIO_InitStruct.Pin = SC_Col1_Pin|SC_Col2_Pin|SC_Col3_Pin|SC_Col4_Pin;
  GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
  GPIO_InitStruct.Pull = GPIO_PULLUP;
  HAL_GPIO_Init(GPIOF, &GPIO_InitStruct);

  /*Configure GPIO pins : PAPin PAPin PAPin */
  GPIO_InitStruct.Pin = O_LunSuo_R_Pin|O_LunShen_R_Pin|O_LunSuo_L_Pin;
  GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
  GPIO_InitStruct.Pull = GPIO_NOPULL;
  GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
  HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);

  /*Configure GPIO pins : PCPin PCPin */
  GPIO_InitStruct.Pin = O_LunShen_L_Pin|O_WeiJiang_R_Pin;
  GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
  GPIO_InitStruct.Pull = GPIO_NOPULL;
  GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
  HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);

  /*Configure GPIO pins : PBPin PBPin PBPin */
  GPIO_InitStruct.Pin = O_WeiSheng_R_Pin|O_WeiJiang_L_Pin|O_WeiSheng_L_Pin;
  GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
  GPIO_InitStruct.Pull = GPIO_NOPULL;
  GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
  HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);

  /*Configure GPIO pins : PGPin PGPin */
  GPIO_InitStruct.Pin = O_FuSheng_R_Pin|O_FuJiang_L_Pin;
  GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
  GPIO_InitStruct.Pull = GPIO_NOPULL;
  GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
  HAL_GPIO_Init(GPIOG, &GPIO_InitStruct);

  /*Configure GPIO pins : PBPin PBPin PBPin PBPin 
                           PBPin PBPin PBPin PBPin 
                           PBPin PBPin PBPin */
  GPIO_InitStruct.Pin = YJ_DianYuan_Pin|YJ_Zuo_Pin|YJ_You_Pin|YJ_HuangKai_Pin 
                          |C_TuiDan_R_Pin|C_WeiSheng_L_Pin|C_WeiJiang_L_Pin|C_WeiSheng_R_Pin 
                          |C_WeiJiang_R_Pin|C_LunShen_L_Pin|C_LunSuo_L_Pin;
  GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
  GPIO_InitStruct.Pull = GPIO_PULLUP;
  HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);

  /*Configure GPIO pins : PDPin PDPin PDPin PDPin 
                           PDPin PDPin PDPin PDPin 
                           PDPin PDPin PDPin PDPin 
                           PDPin PDPin PDPin PDPin */
  GPIO_InitStruct.Pin = YJ_HuangSuo_Pin|YJ_LunShen_Pin|YJ_LunSuo_Pin|YJ_FuSheng_Pin 
                          |YJ_FuJiang_Pin|YJ_JiaSheng_Pin|YJ_JiaJiang_Pin|YJ_JiaJin_Pin 
                          |C_HuangKai_Pin|C_HuangSuo_Pin|C_JiaJin_Pin|C_JiaTui_Pin 
                          |C_DingSheng_Pin|C_DingJiang_Pin|C_JiaSheng_Pin|C_JiaJiang_Pin;
  GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
  GPIO_InitStruct.Pull = GPIO_PULLUP;
  HAL_GPIO_Init(GPIOD, &GPIO_InitStruct);

  /*Configure GPIO pins : PGPin PGPin PGPin PGPin 
                           PGPin PGPin PGPin PGPin 
                           PGPin PGPin PGPin PGPin 
                           PGPin PGPin */
  GPIO_InitStruct.Pin = YJ_JiaTui_Pin|YJ_DingSheng_Pin|YJ_DingJiang_Pin|YJ_WeiSheng_Pin 
                          |YJ_WeiJiang_Pin|YJ_ZhuangDan_Pin|YJ_TuiDan_Pin|C_FuSheng_L_Pin 
                          |C_FuJiang_L_Pin|C_FuSheng_R_Pin|C_FuJiang_R_Pin|C_ZhuangDan_L_Pin 
                          |C_TuiDan_L_Pin|C_ZhuangDan_R_Pin;
  GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
  GPIO_InitStruct.Pull = GPIO_PULLUP;
  HAL_GPIO_Init(GPIOG, &GPIO_InitStruct);

  /*Configure GPIO pins : PEPin PEPin */
  GPIO_InitStruct.Pin = C_LunShen_R_Pin|C_LunSuo_R_Pin;
  GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
  GPIO_InitStruct.Pull = GPIO_PULLUP;
  HAL_GPIO_Init(GPIOE, &GPIO_InitStruct);

}

/* USER CODE BEGIN 2 */

/* USER CODE END 2 */

/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
